﻿#r @"..\Microsoft.SharePoint.Client (spo)\Microsoft.SharePoint.Client.dll"
#r @"..\Microsoft.SharePoint.Client (spo)\Microsoft.SharePoint.Client.Runtime.dll"

#load "Client.fs"

open Client
open Microsoft.SharePoint.Client
open Microsoft.SharePoint.Client.Application
open System.Security
    
// =======================================================
// Work with web property bag
// =======================================================

let web = Client.Context.Web
Client.Load web

Client.Load web.AllProperties

for fval in web.AllProperties.FieldValues do
    if not (fval.Key = null || fval.Value = null) then
        let msg = fval.Key.ToString() + " | " + fval.Value.ToString()
        printfn "%s\n" msg